package edu.zju.gis.dbfg.fileserver.operator;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Path;
import java.util.List;

public abstract class FileOperator {

    public abstract boolean exist(String path);

    public abstract boolean isDirectory(String path) throws IOException;

    public abstract boolean create(String path,boolean isFile) throws IOException;

    public abstract boolean deleteFile(String path) throws IOException;

    public abstract boolean rename(File src, File dest);

    public abstract boolean rename(String src, String dest);

    public abstract void deletePath(String... paths) throws IOException;

    public abstract void deletePath(File... paths) throws IOException;

    public abstract void write(String file, Iterable<String> lines) throws IOException;

    public abstract void write(Path path, Iterable<String> lines) throws IOException;

    public abstract boolean upload(OutputStream outputStream, InputStream inputStream) throws IOException;

    public abstract List<String> getAllFilePaths(String filePath, List<String> filePathList) throws IOException;

    public abstract File[] getAllFilePaths(String filePath) throws IOException;

    public abstract void download(String filepath, HttpServletResponse response);
//    public abstract Path upload(File src, File dest) throws IOException;
//    public abstract Path upload(String src,String dest) throws IOException;
}